//
//  KSectionModelConfig.m
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 ZHBen. All rights reserved.
//

#import "KSectionModelConfig.h"

@interface KSectionModelConfig ()

@property (strong,nonatomic) Class sectionViewClass;

@property (strong,nonatomic) NSString * reuseIdentfier;

@end

@implementation KSectionModelConfig

- (instancetype)init
{
    self = [super init];
    if (self)
    {
        _viewHeight = UITableViewAutomaticDimension;
    }
    return self;
}

- (instancetype)copyWithZone:(NSZone *)zone
{
    KSectionModelConfig * config = [[KSectionModelConfig allocWithZone:zone] init];
    config.section = [_section copy];
    config.reuseIdentfier = _reuseIdentfier;
    config.modelClass = _modelClass;
    config.configBlock = _configBlock;
    config.viewHeight = _viewHeight;
    return config;
}

+ (KSectionModelConfig *)configWithSection:(NSInteger)section viewHeight:(CGFloat)viewHeight
{
    KSectionModelConfig * config = [KSectionModelConfig new];
    config.section = @(section);
    config.viewHeight = viewHeight;
    return config;
}

+ (KSectionModelConfig *)configWithModelClass:(Class)modelClass configBlock:(KSectionConfigBlock)configBlock viewHeight:(CGFloat)viewHeight
{
    KSectionModelConfig * config = [KSectionModelConfig new];
    config.modelClass = modelClass;
    config.configBlock = configBlock;
    config.viewHeight = viewHeight;
    return config;
}

@end
